using System;
using PostSharp.Extensibility;

namespace CriticalSystems.Instrumentation
{
    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class |
        AttributeTargets.Method | AttributeTargets.Constructor,
        AllowMultiple = true, Inherited = false)]
    [MulticastAttributeUsage(MulticastTargets.Method | MulticastTargets.InstanceConstructor, AllowMultiple = true)]
    [RequirePostSharp("CriticalSystems.Instrumentation", "CriticalSystems.Instrumentation")]
    public sealed class LoggingAttribute : MulticastAttribute
    {
        private LoggingType loggingType = LoggingType.LogAbnormalExit;

        /// <summary>
        /// Gets/sets the, optional, boundary name.
        /// </summary>
        public string Name { get; set; }

        public LoggingType LoggingType
        {
            get { return this.loggingType;}
            set { this.loggingType = value;}
        }
    }
}